s1 = '123abc hello world 2025'
# 常用操作
print(s1 + '-*-')
print(s1 * 3)
print(len(s1))
print(max(s1), min(s1))
print('s' in s1)

# 字符串遍历
for i in s1:
    print(i)

for i in range(len(s1)):
     print(i, s1[i])

for i, j in enumerate(s1):
    print(i, j)

# str()：类型转换
print(str(123))
print(str((1,)))
print(str([1,2,3]))

# 方法
print(s1.islower())
print(s1.strip())  # 去掉两端空格
print(s1.split(' '))  # 分隔字符串  ['123abc', 'hello', 'world', '2025']
print('-'.join(['hello', 'world', '2025']))  # 字符串以什么符号连接  hello-world-2025

# 文章字数的统计，字母、数字和符号的个数
numbers = letters = symbols = 0
s = input("请输入一篇文章：")
for i in s:
    if i.isdigit():
        numbers += 1
    elif i.isalpha():
        letters += 1
    else:
        symbols += 1
print("字母：%d，数字：%d，符号：%d" %(numbers, letters, symbols))